107 運動成績
public class JPA107 {
public static void main(String argv[]) {
int action = 1, skill = 2, teamgame = 3;
System.out.println("The basketball grade is " + Basketball.calGrade(action, skill, teamgame));
System.out.println("The baseball grade is " + Baseball.calGrade(skill, teamgame));
}
}
class Basketball {
// 計算籃球成績,動作+技巧+團隊表現
public static int calGrade(int a, int s, int t) {
return a + s + t;
}
}
class Baseball {
// 計算棒球成績,10+技巧+團隊表現
public static int calGrade(int s, int t) {
return 10 + s + t;
}
}